fix: empty initial direct edit value for elements with null declared name#2312
Open
mvanhorn wants to merge 1 commit into
Open
fix: empty initial direct edit value for elements with null declared name#2312mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
Member
|
Hello @mvanhorn, Thank you for providing this PR As mentioned in #2275, could you please add an entry to the CHANGELOG as required by the PR template? Please fix the other PR and this one. Thank you. |
…d name The SysON Explorer initial direct-edit provider mapped the resolved element through getDeclaredName(). When that returned null (for example a Dependency), Optional.map collapsed to empty and the code fell back to the computed tree-item label. Validating that prefilled label wrote the display label into the declared name, creating a duplicated short name. When an Element is resolved, return its declared name or an empty string when it is null. The tree-item label fallback is kept only when no Element resolves at all. Bug: eclipse-syson#2221 Signed-off-by: Matt Van Horn <mvanhorn@gmail.com>
ff7b4bf to
d3cd731
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Triggering a direct edit in the SysON Explorer on an element with no declared name (for example a
Dependency) now presents an empty initial value instead of the computed display label.In
SysONExplorerInitialDirectEditTreeItemLabelProvider.handle, the resolved element was mapped throughElement::getDeclaredName. When that returnednull,Optional.mapcollapsed to an emptyOptionaland execution fell through to the tree-item label fallback. Validating that prefilled label then wrote the display label into the element's declared name, which could create a duplicated short name. When anElementis resolved, the provider now returns its declared name, or an empty string when it isnull. The tree-item label fallback is kept only for the case where noElementis resolved at all.Testing
Added
testDirectEditOnElementWithNullDeclaredNametoExplorerViewControllerIntegrationTests, backed by a newRequirementUsagefixture inExplorerView-DirectEdit.sqlthat has a short name but no declared name. The test asserts the initial direct-edit value is an empty string. The existingtestDirectEditOnElementWithShortName(declared name"") still passes.Fixes #2221
PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW
Auto review
Project management
priority:andpr:labels been added to the pull request?area:,type:)Changelog and release notes
CHANGELOG.adocbeen updated to reference the relevant issues?CHANGELOG.adoc? (no API break)CHANGELOG.adoc? (no dependency change)Documentation
Tests